package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.MessageForm;
import com.springboot.cloud.demos.entity.form.MessageQueryForm;
import com.springboot.cloud.demos.entity.form.UnitForm;
import com.springboot.cloud.demos.entity.po.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "ribbon-consumer", fallback = MessageServiceFallback.class)
public interface MessageService {

    @RequestMapping(value = "/message", method = RequestMethod.POST)
    Result<Message> save(@RequestBody MessageForm MessageForm);

    @RequestMapping(value = "/message/{id}", method = RequestMethod.GET)
    Result get(@PathVariable(value = "id") String id);
    
    @RequestMapping(value = "/message/list", method = RequestMethod.POST)
    Result list(@RequestBody MessageQueryForm queryForm);

    @RequestMapping(value = "/message/count", method = RequestMethod.POST)
    Result count(MessageQueryForm queryForm);

    @RequestMapping(value = "/message", method = RequestMethod.PUT)
    Result update(@RequestBody Message messageForm);
}
